package com.leyou.item.controller;

import com.leyou.common.pojo.PageResult;
import com.leyou.item.pojo.Brand;
import com.leyou.item.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/brand")
public class BrandController {
    @Autowired
    private BrandService service;
    @GetMapping("/list")
    public ResponseEntity<PageResult<Brand>> getBrandsByPage(@RequestParam(defaultValue = "1",required = true) Integer pageNum, @RequestParam(defaultValue = "5",required = true) Integer pageSize){
        System.out.println("查询品牌分页");
        return ResponseEntity.ok(service.getBrandsByPage(pageNum,pageSize));
    }
}
